{include file="common/header-member" /}
<main class="member-index">
    <section>
        <div class="layui-main">
          {include file="common/member-nav" /}
        <h4 class="mb30">我的订单</h4>
        <form  action="{:sysuri()}" autocomplete="off" class=" order-search layui-form  ">
            <ul>
                <li>
                    <span>订单号：</span>
                    <div class="block">
                        <input type="text" class="layui-input" name="order_no" value="{$query_search['order_no'] ?? ''}">
                    </div>
                </li>
             
                <li>
                    <span>产品名称：</span>
                    <div class="block">
                        <input type="text" class="layui-input" name="order_goods" value="{$query_search['order_goods'] ?? ''}">
                    </div>
                </li>

                <li>
                    <span>型号：</span>
                    <div class="block">
                        <input type="text" class="layui-input" name="goods_models" value="{$query_search['goods_models'] ?? ''}">
                    </div>
                </li>
               <li>
                <span>下单时间：</span>
                <div class="block">
                    <input type="text" class="layui-input"  id="order_date" name="order_date"  value="{$query_search['order_date'] ?? ''}">
                </div>
            </li>

            <button class="layui-btn" style="border-radius: 20px;"><i class="layui-icon">&#xe615;</i> 搜索</button>
            <button type="reset" style="border-radius: 20px;" class="layui-btn">重置</button>
            </ul>
            
        </form>
      
        <hr>
        
        <ul class="index-order">
            {if count($order_list)} 
                {volist name="order_list" id="order"} 
                <p>订单号 ：{$order.order_no}</p>
                    {volist name="order.goods" id="goods"} 
                        <li>
                          
                            <div class="img_100 img1">
                                
                                <img src="{$goods.goods_thumb}">
                            </div>
                            <div class="content">
                                <p>{$goods.goods_name}</p>
                                <p>{$goods.spec}</p>
                            </div>
                            <hr>
                            <div class="num">
                                <span>  x{$goods.goods_num}</span>
                            
                                </div>
                            <hr>
                            <div class="time">
                                <span>{$order.create_at}</span>
                            </div>
                            <hr>
                            <div class="btn">
                                <a href="/order-detail-{$order.order_no}" class="layui-btn">查看订单</a>
                                <a href="/order-export-{$order.order_no}" class="layui-btn">导出订单</a>
                            </div>
                        </li>
                    {/volist}
                {/volist}
            {/if}
        
        </ul>
        
        
        <div class="pagenum1">
            
<div id="demo-laypage-normal-1"></div>
        </div>
        </div>
    </section>
</main>

{include file="common/footer" /}
<script>
    layui.use(function(){
        var laypage = layui.laypage;
        var laydate = layui.laydate
        laydate.render({ 
            elem: '#order_date'
            ,type: 'date'
            ,range: '/'
            ,trigger:'click'
            });
        // 普通用法
        laypage.render({
            elem: 'demo-laypage-normal-1',
            count: 10, // 数据总数
            curr : {$page},
            count: {$order_count},
            jump: function(obj, first){
                // obj 包含了当前分页的所有参数
                let page = obj.curr;

                // 获取当前 URL 和查询参数
                let url = new URL(location.href);
                let params = new URLSearchParams(url.search);

                // 设置或更新 page 参数
                params.set('page', page);

                // 将更新后的参数应用到 URL
                url.search = params.toString();

                // 首次不执行
                if (!first) {
                        // 跳转到新的 URL
                    location.href = url.toString();
                }
            }
        });

        });
</script>


